@extends('admin.huawei')
@section('content')

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                用户管理
                <small>编辑用户</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 后台主页</a></li>
                <li><a href="#">用户管理</a></li>
                <li class="active">编辑用户</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">快速编辑用户</h3>
                        </div><!-- /.box-header -->
                        <!-- 警告框 -->
	                @if(count($errors) > 0)		        
                    <div class="alert alert-danger alert-dismissable">
	                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×
	                    </button>
	                    <h4><i class="icon fa fa-ban"></i> 警告!</h4>
	                    	<ol>
			        			@foreach ($errors -> all() as $error)
			        			<li>{{ $error }}</li>
			        			@endforeach
			        		</ol>
			        </div>			
			        @endif
                    @if(session('info'))
                                <div  class="alert alert-success alert-dismissable">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                    <h4>    <i class="icon fa fa-check"></i> 提示!</h4>
                                    <h5 style='font-weight: 800'>{{ session('info') }} 你没有更改数据</h5>
                                    <a href="{{ url('/admin/user/index') }}">点击返回</a>
                                </div>
                    @endif
                        <!-- form start -->
                        <form role="form" action="{{ url('/admin/user/update') }}" method="post">
                      		{{ csrf_field() }}
                            <div class="box-body">
                                <input type="hidden" name='id' value='{{ $data -> id }}'>
                                @if($url['page'])
                                    <input type="hidden" name='page' value='{{ $url['page'] }}'>
                                @endif
                                @if($url['keyword'])
                                    <input type="hidden" name='keyword' value='{{ $url['keyword'] }}'>
                                @endif
                                @if($url['num'])
                                    <input type="hidden" name='num' value='{{ $url['num'] }}'>
                                @endif
                                <div class="form-group">
                                    <label for="exampleInputEmail1">用户名</label>
                                    <input type="text" value="{{ $data -> name }}" name='name' class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入8-16位用户名">
                                </div>                              
                                <div class="form-group">
                                    <label for="exampleInputEmail1">邮箱</label>
                                    <input type="text" value="{{ $data -> email }}"  name='email' class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入正确的邮箱">
                                </div>                                
                                <div class="form-group">
                                    <label for="exampleInputEmail1">手机号码</label>
                                    <input type="text" value="{{ $data -> phone }}"  name='phone' class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入11位的手机号码">
                                </div>
                            </div><!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">更新用户</button>
                                <button type="reset" class="btn btn-default">重置</button>
                            </div>
                        </form>
                    </div><!-- /.box -->
                </div><!--/.col (left) -->
            </div>   <!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->


@endsection('content')